package com.dhh.toodledo.model;

import com.dhh.toodledo.util.CUtil;

public class Task {
	private Long id;
	private String title  ;
	private String tag ;
	private Long folder ;
	private Long context ;
	private Long goal ;
	private Long location ;
	private Long parent ;
	private Long children ;
	private Long order ;
	private Long duedate = Long.valueOf(0);
	private Long duedatemod ;
	private Long startdate = Long.valueOf(0);
	private Long duetime ;
	private Long starttime ;
	private Long remind ;
	private Long repeat ;
	private Long repeatfrom ;
	private Long status ;
	private Long length ;
	private Long priority = Long.valueOf(-2);
	private Long star = Long.valueOf(0);
	private Long modified ;
	private Long completed ;
	private Long added ;
	private Long timer ;
	private Long timeron ;
	private String note ;
	private String meta ;
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getTag() {
		return tag;
	}
	public void setTag(String tag) {
		this.tag = tag;
	}
	public Long getFolder() {
		return folder;
	}
	public void setFolder(Long folder) {
		this.folder = folder;
	}
	public Long getContext() {
		return context;
	}
	public void setContext(Long context) {
		this.context = context;
	}
	public Long getGoal() {
		return goal;
	}
	public void setGoal(Long goal) {
		this.goal = goal;
	}
	public Long getLocation() {
		return location;
	}
	public void setLocation(Long location) {
		this.location = location;
	}
	public Long getParent() {
		return parent;
	}
	public void setParent(Long parent) {
		this.parent = parent;
	}
	public Long getChildren() {
		return children;
	}
	public void setChildren(Long children) {
		this.children = children;
	}
	public Long getOrder() {
		return order;
	}
	public void setOrder(Long order) {
		this.order = order;
	}
	public Long getDuedate() {
		return duedate;
	}
	public void setDuedate(Long duedate) {
		this.duedate = duedate;
	}
	public Long getDuedatemod() {
		return duedatemod;
	}
	public void setDuedatemod(Long duedatemod) {
		this.duedatemod = duedatemod;
	}
	public Long getStartdate() {
		return startdate;
	}
	public void setStartdate(Long startdate) {
		this.startdate = startdate;
	}
	public Long getDuetime() {
		return duetime;
	}
	public void setDuetime(Long duetime) {
		this.duetime = duetime;
	}
	public Long getStarttime() {
		return starttime;
	}
	public void setStarttime(Long starttime) {
		this.starttime = starttime;
	}
	public Long getRemind() {
		return remind;
	}
	public void setRemind(Long remind) {
		this.remind = remind;
	}
	public Long getRepeat() {
		return repeat;
	}
	public void setRepeat(Long repeat) {
		this.repeat = repeat;
	}
	public Long getRepeatfrom() {
		return repeatfrom;
	}
	public void setRepeatfrom(Long repeatfrom) {
		this.repeatfrom = repeatfrom;
	}
	public Long getStatus() {
		return status;
	}
	public void setStatus(Long status) {
		this.status = status;
	}
	public Long getLength() {
		return length;
	}
	public void setLength(Long length) {
		this.length = length;
	}
	public Long getPriority() {
		return priority;
	}
	public void setPriority(Long priority) {
		this.priority = priority;
	}
	public Long getStar() {
		return star;
	}
	public void setStar(Long star) {
		this.star = star;
	}
	public Long getModified() {
		return modified;
	}
	public void setModified(Long modified) {
		this.modified = modified;
	}
	public Long getCompleted() {
		return completed;
	}
	public void setCompleted(Long completed) {
		this.completed = completed;
	}
	public Long getAdded() {
		return added;
	}
	public void setAdded(Long added) {
		this.added = added;
	}
	public Long getTimer() {
		return timer;
	}
	public void setTimer(Long timer) {
		this.timer = timer;
	}
	public Long getTimeron() {
		return timeron;
	}
	public void setTimeron(Long timeron) {
		this.timeron = timeron;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public String getMeta() {
		return meta;
	}
	public void setMeta(String meta) {
		this.meta = meta;
	}
	
	public String getPriorityTitle() {
		String title = "";
		if(priority==null){
			title = "";
		}else if(this.priority==-1){
			title = "Negative";
		}else if(this.priority==0){
			title = "Low";
		}else if(this.priority==1){
			title = "Medium";
		}else if(this.priority==2){
			title = "High";
		}else if(this.priority==3){
			title = "Top";
		}
		
		return title;
	}
	
	public String getStartdateTitle(int dateFormat) {
		String date = "no date";
		
		if(getStartdate()>0){
			date = CUtil.getDate(getStartdate(), dateFormat);
		}
		
		return date;
	}
	
	public String getDuedateTitle(int dateFormat) {
		String date = "no date";
		
		if(getDuedate()>0){
			date = CUtil.getDate(getDuedate(), dateFormat);
		}
		
		return date;
	}
	
	public String getStatusTitle() {
		String name = "";
		if(status==null){
			name = "";
		}else if(status==0){
			name = "None";
		}else if(status==1){
			name = "Next Action";
		}else if(status==2){
			name = "Active";
		}else if(status==3){
			name = "Planning";
		}else if(status==4){
			name = "Delegated";
		}else if(status==5){
			name = "Waiting";
		}else if(status==6){
			name = "Hold";
		}else if(status==7){
			name = "Postponed";
		}else if(status==8){
			name = "Someday";
		}else if(status==9){
			name = "Canceled";
		}else if(status==10){
			name = "Reference";
		}		
		
		return name;
	}
	
	public static String[] getColumns(){
		String[] columns = new String[]{"id","title","tag","folder","context","goal","location","parent","children","task_order","duedate","duedatemod","startdate","duetime","starttime","remind","repeat","repeatfrom","status","length","priority","star","modified","completed","added","timer","timeron","note","meta"};
		return columns;
	}
}


















